<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <title>
            <%= htmlWebpackPlugin.options.title %>
        </title>
        <script>
            document.addEventListener('DOMContentLoaded', function() {
                document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
            })
        </script>
        <link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
		<script type="text/javascript" src="//assets.zjzwfw.gov.cn/assets/ZWJSBridge/1.0.1/zwjsbridge.js"></script>
    </head>
    <body>
        <noscript>
            <strong>Please enable JavaScript to continue.</strong>
        </noscript>
        <div id="app"></div>
        <!-- built files will be auto injected -->
    </body>
	<script type="text/javascript">
        
		ZWJSBridge.onReady(() => { console.log('初始化完成') })
		/**window.onload = (function(w, d, s, q, i) {
            w[q] = w[q] || [];
            var f = d.getElementsByTagName(s)[0],j = d.createElement(s);
            j.async = true;
            j.id = 'beacon-aplus';
            j.src = 'https://d.alicdn.com/alilog/mlog/aplus.js?id=202951085';
            f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'aplus_queue');**/	
        window.onload = function() {
            (function(w, d, s, q, i) {
            w[q] = w[q] || [];
            var f = d.getElementsByTagName(s)[0],j = d.createElement(s);
            j.async = true;
            j.id = 'beacon-aplus';
            j.src = 'https://d.alicdn.com/alilog/mlog/aplus.js?id=202951085';
            f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'aplus_queue');
        aplus_queue.push({
        action: 'aplus.setMetaInfo', arguments: ['aplus-rhost-v', 'alog.zjzwfw.gov.cn']
        });
        aplus_queue.push({
        action: 'aplus.setMetaInfo', arguments: ['aplus-rhost-g', 'alog.zjzwfw.gov.cn']
        });
        aplus_queue.push({
        action: 'aplus.setMetaInfo',
        arguments: ['appId', '60506758']
        });
        // 单页应用 或 “单个页面”需异步补充 PV 日志参数还需进行如下埋点： 
        aplus_queue.push({ action: 'aplus.setMetaInfo', arguments: ['aplus-waiting', 'MAN'] }); 
        // 单页应用路由切换后 或 在异步获取到 pv 日志所需的参数后再执行 sendPV： 
        aplus_queue.push({ 'action':'aplus.sendPV', 'arguments':[{ is_auto: false }, {
           // 自定义 PV 参数 key-value 键值对（只能是这种平铺的 json，不能做多层 嵌套），如： 
           miniAppId:'2001101270',
           miniAppName:'金华人社',
        }] })
    }
        //popstate
        window.addEventListener('popstate', function (event) {
            console.log('popstate');
            console.log(event);
            if(ZWJSBridge) {
                try {
                    ZWJSBridge.close().then((result) => {
                        console.log(result);
                    }).catch((error) => {
                        console.log(error);
                    });
                }catch (e) {
                }
            }
            if(AlipayJSBridge) {
                try {
                    AlipayJSBridge.call('closeWebview')
                } catch (e) {
                    console.log(e)
                }
            }
        },false);
        window.addEventListener('pageshow', function (event) {
            if(event.persisted || window.performance && window.performance.navigation.type == 2){
                console.log('window.performance.navigation.type: '+ window.performance.navigation.type)
                if(ZWJSBridge) {
                    try {
                        ZWJSBridge.close().then((result) => {
                            console.log(result);
                        }).catch((error) => {
                            console.log(error);
                        });
                    }catch (e) {
                    }
                }
                if(AlipayJSBridge) {
                    try {
                        AlipayJSBridge.call('closeWebview')
                    } catch (e) {
                        console.log(e)
                    }
                }
            }
        },false);
	</script>
</html>